package com.herr.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/views")
public class HelloController {
    /*
    * 启动前，需要设置web resource dictionary目录。需要mark WEB-INF/config目录为resource目录
    * ${pageContext.request.contextPath}/views/showName.iherr?username=111
    * */
    @RequestMapping("/showName")
    public ModelAndView showName(String username){
        System.out.println (username);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject ("username", username);
        modelAndView.setViewName ("showName");
        return modelAndView;
    }
}
